package com.itheima.tlias.pojo.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
public class UpdateClazzParam {
    @NotNull
    private int id;
    @NotNull
    @Length(min = 4,max = 30,message = "班级名称长度必须在4-30之间")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5a-zA-Z0-9]+$",message = "班级名称非法")
    private String name;
    @Length(min = 1,max = 20,message = "教室名称长度必须在1-20之间")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5a-zA-Z0-9]+$",message = "教室名称非法")
    private String room;
    @NotNull
    @Pattern(regexp = "^\\d{4}-\\d{2}-\\d{2}$",message = "开课时间格式错误")
    private LocalDate beginDate;
    @NotNull
    @Pattern(regexp = "^\\d{4}-\\d{2}-\\d{2}$",message = "结课时间格式错误")
    private LocalDate endDate;
    private Integer masterId;
    private Integer subject;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}
